home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / connect.z / connect
Encoding:
Text File  |  2002-10-03  |  4.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4. CCCCOOOONNNNNNNNEEEECCCCTTTT((((2222))))                                                          CCCCOOOONNNNNNNNEEEECCCCTTTT((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      connect - initiate a connection on a socket
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
  14.  
  15.      iiiinnnntttt ccccoooonnnnnnnneeeecccctttt ((((iiiinnnntttt ssss,,,, ccccoooonnnnsssstttt ssssttttrrrruuuucccctttt ssssoooocccckkkkaaaaddddddddrrrr ****nnnnaaaammmmeeee,,,, iiiinnnntttt nnnnaaaammmmeeeelllleeeennnn))));;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      The parameter _s is a socket.  If it is of type SOCK_DGRAM, then this call
  19.      specifies the peer with which the socket is to be associated; this
  20.      address is that to which datagrams are to be sent, and the only address
  21.      from which datagrams are to be received.  If the socket is of type
  22.      SOCK_STREAM, then this call attempts to make a connection to another
  23.      socket.  The other socket is specified by _n_a_m_e, which is an address in
  24.      the communications space of the socket.  Each communications space
  25.      interprets the _n_a_m_e parameter in its own way.  Generally, stream sockets
  26.      may successfully _c_o_n_n_e_c_t only once; datagram sockets may use _c_o_n_n_e_c_t
  27.      multiple times to change their association.  Datagram sockets may
  28.      dissolve the association by connecting to an invalid address, such as a
  29.      zero-filled address.
  30.  
  31. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  32.      If the connection or binding succeeds, then 0 is returned.  Otherwise a
  33.      -1 is returned, and a more specific error code is stored in _e_r_r_n_o.
  34.  
  35. EEEERRRRRRRROOOORRRRSSSS
  36.      The call fails if:
  37.  
  38.      [EBADF]             _S is not a valid descriptor.
  39.  
  40.      [ENOTSOCK]          _S is a descriptor for a file, not a socket.
  41.  
  42.      [EADDRNOTAVAIL]     The specified address is not available on this
  43.                          machine.
  44.  
  45.      [EAFNOSUPPORT]      Addresses in the specified address family cannot be
  46.                          used with this socket.
  47.  
  48.      [EISCONN]           The socket is already connected.
  49.  
  50.      [ETIMEDOUT]         Connection establishment timed out without
  51.                          establishing a connection.
  52.  
  53.      [ECONNREFUSED]      The attempt to connect was forcefully rejected.
  54.  
  55.      [ENETUNREACH]       The network isn't reachable from this host.
  56.  
  57.      [EADDRINUSE]        The address is already in use.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCOOOONNNNNNNNEEEECCCCTTTT((((2222))))                                                          CCCCOOOONNNNNNNNEEEECCCCTTTT((((2222))))
  71.  
  72.  
  73.  
  74.      [EFAULT]            The _n_a_m_e parameter specifies an area outside the
  75.                          process address space.
  76.  
  77.      [EINPROGRESS]       The socket is non-blocking and the connection cannot
  78.                          be completed immediately.  It is possible to
  79.                          _s_e_l_e_c_t(2) for completion by selecting the socket for
  80.                          writing.
  81.  
  82.      [EALREADY]          The socket is non-blocking and a previous connection
  83.                          attempt has not yet been completed.
  84.  
  85.      See also the protocol-specific manual pages for other error values.
  86.  
  87. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  88.      accept(2), select(2), socket(2), tcp(7P), udp(7P), unix(7F)
  89.  
  90. NNNNOOOOTTTTEEEE
  91.      ABI-compliant versions of the above call can be obtained from
  92.      _l_i_b_s_o_c_k_e_t._s_o.
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.